import { ref } from "vue";
import { TableColumn, TableOptions, TableData } from "@table/interface";
import { SearchOptions } from "@table/components/Tools/interface";
import { searchOptionsDefault } from "@table/constant";

export let global = () => {
  return {
    originalTableColumns: ref<TableColumn[]>([]),

    tableColumns: ref<TableColumn[]>([]),

    searchOptions: ref<SearchOptions>(JSON.parse(JSON.stringify(searchOptionsDefault))),

    options: ref<TableOptions>(),

    tableData: ref<TableData[]>([]),

    doms: {
      //  Record<string, HTMLElement[]>
      fixedDoms: []
    },
    tableScrollRef: ref(),
    api: null,
    afterApiTransformData: null
  };
};
